首页>代码>基于ssm框架的微信小程序图书管理系统>/图书管理系统pw/项目三 - 副本/StuBook5/src/com/client/utils/GsonIgnoreStrategy.java
package com.client.utils;

import java.lang.annotation.Annotation;
import java.util.Collection;

import com.google.gson.ExclusionStrategy;
import com.google.gson.FieldAttributes; 

/**
 * gson
 */
public class GsonIgnoreStrategy implements ExclusionStrategy {

    /*
     * (non-Javadoc)
     *
     * @see com.google.gson.ExclusionStrategy#shouldSkipClass(java.lang.Class)
     */
    @Override
    public boolean shouldSkipClass(Class<?> clazz) {
        return false;
    }

    /*
     * (non-Javadoc)
     *
     * @see com.google.gson.ExclusionStrategy#shouldSkipField(com.google.gson.
     * FieldAttributes)
     */
    @Override
    public boolean shouldSkipField(FieldAttributes fieldAttributes) {
        Collection<Annotation> annotations = fieldAttributes.getAnnotations();
        for (Annotation annotation : annotations) {
            if (annotation.annotationType() == GsonIgnore.class) {
                return true;
            }
        }
        return false;
    }
}
最近下载更多
amayaT  LV5 4月23日
ewan007  LV29 3月4日
Lyj 329511  LV4 2023年10月11日
348835269  LV11 2023年9月26日
dzlwindy  LV8 2023年7月12日
小屁孩  LV7 2023年6月2日
ericxu1116  LV24 2023年5月28日
高腾达  LV3 2023年5月26日
xiaoliangPIp  LV3 2023年4月27日
sunlzh888888  LV28 2023年4月26日
最近浏览更多
寄此123456  LV1 4月30日
xk9587  LV16 4月29日
amayaT  LV5 4月23日
唐僧洗头爱飘柔  LV22 4月16日
朤朤朤朤朤朤  LV3 4月14日
李二san  LV1 4月13日
li739784276  LV5 3月26日
Boss绝  LV9 3月3日
暂无贡献等级
Okkkkkk 1月18日
暂无贡献等级
顶部 客服 微信二维码 底部
>扫描二维码关注最代码为好友扫描二维码关注最代码为好友